import { Component, ViewChild } from '@angular/core';
import { PdfJsViewerComponent } from 'ng-pdfjs-viewer';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent {
  @ViewChild('PdfViewer', { static: true }) public PdfViewer : PdfJsViewerComponent;

  constructor() { }

  ngOnInit() {
  }

  public testBeforePrint() {
    console.log('testBeforePrint() successfully called');
  }

  public testAfterPrint() {
    console.log('testAfterPrint() successfully called');
  }

  public testPagesLoaded(count: number) {
    console.log('testPagesLoaded() successfully called. Total pages # : ' + count);
  }

  public testPageChange(pageNumber: number) {
    console.log('testPageChange() successfully called. Current page # : ' + pageNumber);
  }

  click(){
    this.PdfViewer.pdfSrc = '1110164.pdf';
    this.PdfViewer.refresh();

    //window.open('/assets/pdfjs/web/viewer.html')
  }
}
